<template>
  <div class="goods" @click="todateil(item)" style="width:50%;">
    <div class="goods_box">
      <img :src="item.show.img" alt="">
      <p>{{item.title}}</p>
      <div>
        <span class="price">¥{{item.price}}</span>
        <span class="cfav"><img src="/img/common/collect.svg" class="icon">{{item.cfav}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["item"],
  methods: {
    todateil(item){
      let _obj= JSON.stringify(item)
      this.$router.push({path:'/dateil',query:{ _obj}})
    }
  },
};
</script>

<style lang="scss">
.goods {
  box-sizing: border-box;
  padding: 8px;
  .goods_box {
    text-align: center;
    width: 100%;
    img {
      width: 100%;
      // height: 286.5px;
    }
    p {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .price {
      color: #e7432d;
      margin-right: 6px;
    }
    .cfav {
      .icon {
        width: 22px;
        height: 20px;
        display: inline-block;
        vertical-align: bottom;
      }
    }
  }
}
</style>